﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace myLittleC
{

	enum ERRORS
    {
        EOF,
        
        UnknownError,
        
        InvalidConstInt,
        InvalidConstString,
        InvalidConstFloat,
        InvalidEscSeq,

        //Parser
        BadExpression, 
        BadUnaryExp,
        UnExpRightParan,
        BadLValue,
        
        //Sim Declarations
        BadDeclaration,
        DublDeclaration,

        NotDefType,

        //Parse Defs

        UnExpSemicolon,
        NotUnicDef,
        NotArraySize,
        UnExpRBreak,
        CantDefsVar,
        CantDefsFunk,
        UnExpFinRace,
        UnExpIdent,
        UnExpType,
        UnIdefSymbol,
        CanDefsExpr,
		EmpryStruct,
		NotUnicDefOrCantDefsFunk,

    }

    enum TokenType
    {
        None = 0,
        EOF,    

        ConstInt,
        ConstString,
        ConstFloat,

        Operation,
        Separator,

        KeyWord,      
        Identeficator
    }

    enum ExpType
    {
        None = 0,
        Int,
        Float
    }

    enum ArOperations
    { 

    }

    enum SubTokenType
    {
        None = 0,

        //ConstTokenType

        CONST_TOKEN_TYPE_START,
            CTT_INT,
            CTT_FLOAT,
            CTT_STR,
        CONST_TOKEN_TYPE_END,

        //IdentTokenType
       
        ResWordsStarts,
            rwConst,
            rwDo,
            rwElse,
            rwFloat,
            rwFor,
            rwIf,
            rwInt,
            rwPrintf,
            rwReturn,
            rwStruct,         
            rwTypedef,
            rwVoid,
            rwWhile,
        ResWordsFinish,
        Identeficator,

        OperationsStart, //sorted by prioreted
            Increment, //++ 
            Decrement, //--
            Not,

            Multiply,
            Division,   // /
            Div,        // %

            Add,
            Sub,

            SHL,
            SHR,

            Low,
            Hi,
            
            LowOrEq,
            HiOrEq,

            Equal,
            NotEqual,
            
            And,

            Or,

            LogicalAnd,

            LogicalOr,

            Assignment,
            AddAssignment,     
            SubAssignment,  
            OrAssignment, 
            AndAssignment,           
            MultiplyAssigment,            
            DivisionAssignment,
            DivAssigment,
            Dot,            
            
        OperationsEnd,

        //SeParatorTokenType
        SEPORATOR_START,
            SPTT_LPAR,		// PARANTHESIS ( )
            SPTT_RPAR,
            SPTT_COMMA,		//,
            SPTT_COLON,		//:
            SPTT_SEMICOLON,	//;
            SPTT_LBRACKET,	// SQUARE BRACKET  []
            SPTT_RBRACKET,
            SPTT_LBRACE,	//фигурные {}
            SPTT_RBRACE,        
        SEPORATOR_END,

        EOF = 1000
    }
    
    enum CONDITIONS
    {
        WhiteSpaces = 0,
        IntConst = 1,
        IntOctConst = 40,
        IntHexConst = 41,
        FloatConst = 2,
        Identifier = 6,
        ZNAK_OPERACII_ONE,
        ZNAK_OPERACII_TWO,
        Division,
        CommentOdn,
        Or,
        LogicalOr,
        And,
        LogicalAnd,
        Separator,
        CommentMnog = 16,        
        StringConst = 18,
        EOF = 20,
        Add = 22,
        Increment,
        AddAssignment,
        Substraction,
        Decrement,
        SubAssignment,
        Low,
        SHL,
        LowOrEq,
        Hi,
        SHR,
        HiOrEq,
        Dot,

        UnGet = 200,	
        Get,		
        Error,				
        ErrorInConst,	
        ErrorEofComment,
    }    

    enum SimpleCharType
    {
        none,
        Variable,
        Array,
        Struct,
        Procedure
    }
}
